package model

import "time"

type User struct {
	Id          int64      `json:"id,omitempty"`
	Openid      string     `json:"openid"`
	Nickname    string     `json:"nickname"`
	Language    string     `json:"language"`
	City        string     `json:"city"`
	Province    string     `json:"province"`
	Country     string     `json:"country"`
	AvatarUrl   string     `json:"avatar_url"`
	Username    string     `json:"username"`
	Password    string     `json:"password,omitempty"`
	Sex         uint8      `json:"sex,omitempty"`
	Balance     float64    `json:"balance,omitempty"`
	Integral    uint       `json:"integral,omitempty"`
	DeletedTime *time.Time `json:"deleted_time,omitempty"`
	UpdatedTime *time.Time `json:"updated_time,omitempty"`
	CreatedTime *time.Time `json:"created_time,omitempty"`
}

// TableName 会将 User 的表名重写为 `user`
func (User) TableName() string {
	return "user"
}
